<script lang="ts" setup name="Son1">
    import { ref } from 'vue';
    import emitter from '@/utils/emitter';

    let toy = ref('奥特曼');
</script>

<template>
    <div class="son">
        <h3>子组件1</h3>
        <p>玩具：{{ toy }}</p>
        <button @click="emitter.emit('send-toy', toy)">把玩具给弟弟玩</button>
    </div>
</template>

<style scoped>
    .son {
        background-color: skyblue;
        border-radius: 10px;
        padding: 5px 10px;
    }
</style>